#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QUdpSocket>
#include <QLineEdit>
#include <QSettings>
#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_browButton_clicked();
    void on_virtual_add_clicked();
    void on_virtual_clear_clicked();
    void on_virtual_del_clicked();
    void on_tabWidget_tabBarClicked(int index);
    void on_tab_rename_triggered();
    void on_tab_delete_triggered();
    void on_tab_real_triggered();
    void on_tab_virtual_triggered();
    void on_tabWidget_customContextMenuRequested(const QPoint &pos);
    void on_tabWidget_currentChanged(int index);
    void on_tftp_progress(int rowid, qint64 trans, qint64 total);

public slots:
    void handTFTPRequest();

private:
    void initConfig();
    void initServer();
    QWidget *createTabView();

private:
    Ui::MainWindow *ui;
    QSettings *mSetting;
    QUdpSocket *mSocket;
};
#endif // MAINWINDOW_H
